package com.whg.es.service;

import com.whg.es.model.NBAPlayer;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @Author whg
 * @create 2023/7/4 18:25
 * @description：
 */
public interface NBAPlayerService {

    /**
     * 添加运动员
     * @param player
     * @param id
     * @return
     */
    Boolean addPlayer(NBAPlayer player,String id) throws IOException;

    /**
     * 获取运动员
     * @param id
     * @return
     * @throws IOException
     */
    Map<String,Object> getPlayer(String id) throws IOException;

    /**
     * 更新运动员
     * @param player
     * @param id
     * @return
     */
    Boolean updatePlayer(NBAPlayer player,String id) throws IOException;

    /**
     * 删除运动员
     * @param id
     * @return
     * @throws IOException
     */
    Boolean deletePlayer(String id) throws IOException;

    /**
     * 删除所有的运动员
     * @return
     * @throws IOException
     */
    Boolean deleteAllPlayer() throws IOException;

    /**
     * 导入所有的运动员
     * @return
     * @throws IOException
     */
    Boolean importAllPlayer() throws IOException;

    /**
     * 匹配查询运动员
     * @param key
     * @param value
     * @return
     * @throws IOException
     */
    List<NBAPlayer> searchMatch(String key,String value) throws IOException;

    /**
     * 精准查询运动员
     * @param key
     * @param value
     * @return
     * @throws IOException
     */
    List<NBAPlayer> searchTerm(String key,String value) throws IOException;

    /**
     * 前缀查询运动员
     * @param key
     * @param value
     * @return
     * @throws IOException
     */
    List<NBAPlayer> searchPrefix(String key,String value) throws IOException;
}
